import 'package:flutter/material.dart';
import 'package:flutter_application_1/pages/my_page/my_logic.dart';
import 'package:get/get.dart';

import 'list_logic.dart';

class ListPage extends GetView<ListLogic> {
  const ListPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(title: Text('列表页')),
      body: Center(
        child: Obx(() {
          return Column(
            children: [
              Text(controller.msg.value),
              Text('id = ${controller.id.value}'),
              Text('共享 name = ${controller.myLogic.users["name"]}'),
              const SizedBox(height: 6),
              Text('共享 num  = ${controller.myLogic.num.value}'),
              ElevatedButton(
                onPressed: () {
                  controller.myLogic.add();
                },
                child: Icon(Icons.add),
              ),
            ],
          );
        }),
      ),
    );
  }
}
